$(function () {
    getGrid();
    $('.toolbar-grid button').click(function () {
        var _url = '';
        if(this.id=='add'){
            _url += '/project/get?id';
            parent.changeIframeSrc([{url:'/project/list',title:'项目列表'},{url:_url,title:'添加'}]);
        }else if(this.id=='del'){
            _url += '/project/del?id=1';
            alert("删除数据");
        }else if(this.id=='process'){
            alert("绑定流程");
        }
    });
});
function getGrid() {
    $('.datatable').datatable({
        data: {
            cols: [
                {width: 20, text: '#', type: 'number', colClass: 'text-center'},
                {width: 80, text: '创建时间', type: 'date'},
                {width: 150, text: '项目名称', type: 'string'},
                {width: 100, text: '项目描述', type: 'string'}
            ],
            rows: [
                {checked: false, data: [1, '2017-06-18 11:05:15', '四姑娘山旅游系统','四姑娘山旅游系统']},
                {checked: false, data: [2, '2017-06-18 09:08:10', '三亚旅游系统', '三亚旅游系统']},
                {checked: false, data: [3, '2017-06-18 09:00:35', '西藏旅游系统', '西藏旅游系统']}
            ]
        },checkable: true,
        sortable: false
    });
}